﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Anito.Data;
using Anito.Data.Mapping;

namespace Freetime.Base.Data.Entities
{
    [Source(View = "UserAccountView",
        Update = "UserAccount")]
    public class UserAccount : AuditableEntity
    {
        public UserAccount(ISession session) :
            base(session)
        {
        }
        public UserAccount()
        {
        }

        protected int _ID;

        [DataField(FieldName = "ID"
            , MemberName = "_ID"
            , Identity = true
            , PrimaryKey = true
            )]
        public virtual int ID
        {
            get
            {
                return _ID;
            }
            set
            {
                SetField<int>("ID", ref _ID, value);
            }
        }

        protected string _LoginName;

        [DataField(FieldName = "LoginName"
            , MemberName = "_LoginName"
            , Size = 250
            )]
        public virtual string LoginName
        {
            get
            {
                return _LoginName;
            }
            set
            {
                SetField<string>("LoginName", ref _LoginName, value);
            }
        }

        protected string _Password;

        [DataField(FieldName = "Password"
            , MemberName = "_Password"
            , Size = 250
            )]
        public virtual string Password
        {
            get
            {
                return _Password;
            }
            set
            {
                SetField<string>("Password", ref _Password, value);
            }
        }

        protected int _UserRole;

        [DataField(FieldName = "UserRole"
            , MemberName = "_UserRole"
            )]
        public virtual int UserRole
        {
            get
            {
                return _UserRole;
            }
            set
            {
                SetField<int>("UserRole", ref _UserRole, value);
            }
        }

        protected string _Name;

        [DataField(FieldName = "Name"
            , MemberName = "_Name"
            , Size = 250
            )]
        public virtual string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                SetField<string>("Name", ref _Name, value);
            }
        }

        protected int _UserProfile;

        [DataField(FieldName = "UserProfile"
            , MemberName = "_UserProfile"
            )]
        public virtual int UserProfile
        {
            get
            {
                return _UserProfile;
            }
            set
            {
                SetField<int>("UserProfile", ref _UserProfile, value);
            }
        }

        protected int _WebTheme;

        [DataField(FieldName = "WebTheme"
            , MemberName = "_WebTheme")]
        public virtual int WebTheme
        {
            get
            {
                return _WebTheme;
            }
            set
            {
                SetField<int>("WebTheme", ref _WebTheme, value);
            }
        }

        protected string _Theme;

        [DataField(FieldName = "Theme"
            , MemberName = "_Theme")]
        public virtual string Theme
        {
            get
            {
                return _Theme;
            }
            set
            {
                SetField<string>("Theme", ref _Theme, value);
            }
        }

        protected bool _IsActive;

        [DataField(FieldName = "IsActive"
            , MemberName = "_IsActive"
            )]
        public virtual bool IsActive
        {
            get
            {
                return _IsActive;
            }
            set
            {
                SetField<bool>("IsActive", ref _IsActive, value);
            }
        }
    }
}
